# ************************************
# Managed by Puppet
# ************************************

NameVirtualHost <%= @vhost_name %>:<%= @port %>
<VirtualHost <%= @vhost_name %>:<%= @port %>>
    ServerName <%= @srvname %>
    <% if @serveraliases.is_a? Array -%>
      <% @serveraliases.each do |name| -%><%= "  ServerAlias #{name}\n" %><% end -%>
    <% elsif @serveraliases != nil -%>
      <%= "  ServerAlias #{@serveraliases}" -%>
    <% end -%>

    DocumentRoot <%= @docroot %>
    <Directory <%= @docroot %>>
        Options Indexes FollowSymLinks MultiViews
        Satisfy any
        Require all granted
    </Directory>

    Alias /robots.txt /var/www/robots.txt
    <Directory "/var/www/robots.txt">
      Require all granted
    </Directory>

    ErrorLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_error.log
    LogLevel warn
    CustomLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_access.log combined
    ServerSignature Off
</VirtualHost>
